home *** CD-ROM | disk | FTP | other *** search
- Path: dildog.lgc.com!usenet
- From: Glenn Carr <gcarr@tulsa.lgc.com>
- Newsgroups: comp.lang.c
- Subject: "Initializer must be a constant expression"...?
- Date: Fri, 02 Feb 1996 15:22:50 -0600
- Organization: Landmark Graphics, Munro Garrett Products Group
- Message-ID: <311280AA.15FB7483@tulsa.lgc.com>
- NNTP-Posting-Host: aris.tulsa.lgc.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b6a (X11; I; SunOS 4.1B sun4)
-
- We recently switched compilers from gcc to xlc on AIX and we're now getting the
- following compilation warnings...
-
- "../combobox.c", line 244.10: 1506-221 (E) Initializer must be a constant expression.
- "../combobox.c", line 245.10: 1506-221 (E) Initializer must be a constant expression.
- "../combobox.c", line 246.10: 1506-221 (E) Initializer must be a constant expression.
-
- in the following...
-
- typedef struct {
- char **var;
- char *descr;
- } cfgStrSpec_t;
-
- char *pszDepCodeSetKey = NULL;
- char *pszDepComboBox = NULL;
- char *pszShowAllIfEmpty = NULL;
- cfgStrSpec_t pCfgStr[] =
- {
- 244: {&pszDepCodeSetKey, "Dependent code_set_key"},
- 245: {&pszDepComboBox, "Dependent widget (combobox)"},
- 246: {&pszShowAllIfEmpty, "Boolean (nonzero or 0)"},
- {NULL, NULL},
- };
-
- Is that not valid, or ANSI C?
-
- --
- Glenn Carr, gcarr@lgc.com
- Landmark Graphics, MGI
-